<?php

/**
 * List
 *
 * @category    Ext
 * @package     Ext_View
 * @subpackage  Ext_View_Helper
 */
class Ext_View_Helper_ListComma extends Zend_View_Helper_Abstract
{
    public function listComma($items, $fieldNames = array('name'))
    {
        $data = array();
        foreach ($items as $item) {
            $name = array();
            foreach ($fieldNames as $fieldName) {
                $name[] = $item->{$fieldName};
            }
            $data[] = implode(' ', $name);
        }
        return implode(', ', $data);
    }
}